﻿@model PhotoGallery.Models.ViewModels.AudioViewModel
@using PhotoGallery.Views
@{
    ViewBag.Title = "Play";
}
@section javascript {
    <link href="@Url.Content("~/Content/AudioPlay.css")" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/AudioPlay.js")" type="text/javascript"></script>
}
<h2>Play</h2>
<div style="text-align:right">
    <a href="@ViewBag.backUrl">@Labels.back</a>
</div>
@if (@Model.Audio == null)
{
    <image src="@Url.Content("~/Content/no_audio.jpg")" />
}
else
{
    <div style="float:left; background-color:black; padding:10px;">
        <audio id="audio" controls  >
            @*<source src="@Url.Content(Model.Audio.Url)" type="audio/mpeg">*@
            <source src="@Url.Action("Download", new { file = @Model.Audio.FullFileName })" type="video/mp4">
        
            Your browser does not support the audio element.
        </audio>
        <ul id="playlist">
            @foreach (var audio in Model.AudioList)
            {
            <li class="active">
                @*<a href="@Url.Content(audio.Url)">*@
                <a href="@Url.Action("DownloadAudio", new { file = @audio.FullFileName })" >
                    @audio.FileName
                </a>
            </li>
            }
        </ul>

    </div>
}